// 统一处理 localStorage

import storageKey from "@/config/storageKey"
import { type ThemeName } from "@/hooks/useTheme"

export const getSidebarStatus = () => {
  return localStorage.getItem(storageKey.SIDEBAR_STATUS)
}

export const setSidebarStatus = (sidebarStatus: "opened" | "closed") => {
  localStorage.setItem(storageKey.SIDEBAR_STATUS, sidebarStatus)
}

export const getActiveThemeName = () => {
  return localStorage.getItem(storageKey.ACTIVE_THEME_NAME) as ThemeName
}

export const setActiveThemeName = (themeName: ThemeName) => {
  localStorage.setItem(storageKey.ACTIVE_THEME_NAME, themeName)
}
